{% extends "staff/base.html" %}
{% import 'staff/_formhelpers.html' as forms with context %}

{% block title %} Settings - {{ current_course.display_name_with_semester }}{% endblock %}

{% block main %}
  <section class="content-header">
      <h1>
        {{ current_course.display_name_with_semester }} Settings
        <small>{{ current_course.offering }}</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="{{ url_for('.list_courses') }}"><i class="fa fa-list"></i> Courses </a></li>
        <li><a href="{{ url_for("admin.course", cid=current_course.id) }}">
            <i class="fa fa-university"></i> {{ current_course.offering }}
        </a></li>
        <li class="active"><a href="#"><i class="fa fa-cogs"></i> Settings</a></li>
      </ol>
  </section>

  <section class="content">
      {% include 'alerts.html' %}
      <div class="row">
        <div class="col-md-6">
          <!-- Default box -->
            <div class="box">
              <div class="box-header with-border">
                <h3 class="box-title">Edit {{ current_course.display_name_with_semester }}</h3>
              </div>
              <div class="box-body">
                {% call forms.render_form(form, action_url="", action_text='Edit Course', class_='form') %}
                    {{ forms.render_field(form.display_name, label_visible=true, placeholder='CS 61A', type='text') }}
                    {{ forms.render_field(form.institution, label_visible=true, placeholder='UC Berkeley', type='text') }}
                    {{ forms.render_field(form.website, label_visible=true, placeholder='http://cs61a.org/', type='text') }}
                    <!-- {{ forms.render_field(form.timezone, label_visible=true, type='select') }} -->
                    {{ forms.render_field(form.autograder_url, label_visible=true, value=current_course.autograder_url or 'https://autograder.cs61a.org/', type='text') }}
                    {{ forms.render_checkbox_field(form.active, label_visible=true) }}
                    {{ forms.render_field(form.export_access_token, label_visible=true, value=current_course.export_access_token, type='text') }}
                    {{ forms.render_checkbox_field(form.export_access_token_active, label_visible=true) }}
                {% endcall %}
              </div>
              <!-- /.box-body -->
            </div>
            <!-- /.box -->
        </div>
        <div class="col-md-6">
          <!-- Default box -->
            <div class="box">
              <div class="box-header with-border">
                <h3 class="box-title">Links</h3>
              </div>
              <div class="box-body no-padding">
                <ul class="nav nav-pills nav-stacked">
                  <li>
                    <a href="{{ url_for('.course_jobs', cid=current_course.id) }}">
                      <i class="fa fa-file-text"></i> Jobs
                    </a>
                  </li>
                  <li>
                    <a href="{{ url_for('.canvas_course', cid=current_course.id) }}">
                      <i class="fa fa-address-book"></i> bCourses
                    </a>
                  </li>
                </ul>
              </div>
              <!-- /.box-body -->
            </div>
            <!-- /.box -->
        </div>
      </div>
  </section>



  <!-- </body> do not close body in template-->
{% endblock %}
